    /*
 * Copyright 2015 CPE Lyon - IRC 2013/2016 - Cours de programmation réseau - Groupe H
 *
 * This file is part of BOTT.
 *
 * BOTT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 *
 * BOTT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with BOTT. If not, see http://www.gnu.org/licenses/.
 */

/*
 * Serveur de messagerie.
 *
 * Gère un ensemble de clients et de salons.
 */

#ifndef SERVEUR_H
#define SERVEUR_H

/* Définition de la structure d'un client */

typedef struct client client;
struct client {
    int16_t idUser;     // Big endian
    struct in_addr ipUser;
    int16_t portUser;   // Big endian
    char nickname[MAX];
    int listChats[MAX];
};

/* Définition de la structure d'un salon */

typedef struct chat chat;
struct chat {
    int16_t idChat;     // Big endian
    char chatName[MAX];
    int listClients[MAX];
};

/* Définition de la structure utilisée pour passer les données */

typedef struct threadData threadData;
struct threadData {
    int socketDesc;
    bimp_msg receivedData;
    struct sockaddr_in clientAddr;
    client *listClients;
    chat *listChats;
};

#endif